1. Field of the Invention
The present invention relates in general to improved data storage systems and in particular to an improved method and system for updating stored data in a data storage system. Still more particularly, the present invention relates to an improved method and system for increasing performance of a data storage system in updating stored data utilizing non-contiguous data in a cache associated with the data storage system.
2. Description of the Related Art
As the performance of microprocessor and is semiconductor memory technology increases, there is a need for improved data storage systems with comparable performance enhancements. Additionally, in enhancing the performance of data storage systems, there is a need for improved reliability of data stored. In 1988, a paper was published by Patterson, Gibson, Katz, A Case for Redundant Arrays of Inexpensive Disks (RAID), International Conference on Management of Data, pgs. 109-116, June 1988. This paper laid the foundation for the use of redundant arrays of inexpensive disks that would not only improve the data transfer rate and data I/O rate over a comparable single disk access, but would also provide error correction at a lower cost in data storage systems.
RAID includes an array of disks which are typically viewed by a host, such as a computer system, as a single disk. A RAID controller may be a hardware and/or software tool for providing an interface between the host and the array of disks. Preferably, the RAID controller manages the array of disks for storage and retrieval and can view the disks of the RAID separately. The disks included in the array may be any type of data storage systems which can be controlled by the RAID controller when grouped in the array.
The RAID controller is typically configured to access the array of disks as defined by a particular "RAID level." The RAID level specifies how the data is distributed across the disk drives and how error correction is accomplished. In the paper noted above, the authors describe five RAID levels (RAID Level 1-RAID level 5). Since the publication of the paper, additional RAID levels have been designated.
RAID levels are typically distinguished by the benefits included. Three key benefits which may be included in a RAID level are fault tolerance, data availability and high performance. Fault tolerance is typically achieved through an error correction method which ensures that information can be reconstructed in the event of a disk failure. Data availability allows the data array to continue to operate with a failed component. Typically, data availability is achieved through a method of redundancy. Finally, high performance is typically achieved by simultaneous access to multiple disk drives which results in faster I/O and data transfer requests.
Error correction is accomplished, in many RAID levels, by utilizing additional parity data stored with the original data. Parity data may be utilized to recover lost data due to disk failure. Parity data is typically stored on one or more disks dedicated for error correction only, or distributed over all of the disks within an array.
By the method of redundancy, data is stored in multiple disks of the array. Redundancy is a benefit in that redundant data allows the storage system to continue to operate with a failed component while data is being replaced through the error correction method.
Additionally, redundant data is more beneficial than back-up data because back-up data is typically outdated when needed whereas redundant data is current when needed.
In many RAID levels, redundancy is incorporated through data interleaving which distributes the data over all of the data disks in the array. Data interleaving is usually in the form of data "striping" in which data to be stored is broken down into blocks called "stripe units" which are then distributed across the array of disks. Stripe units are typically predefined as a bit, byte, block or other unit. Stripe units are further broken into a plurality of sectors where all sectors are an equivalent predefined size. A "stripe" is a group of corresponding stripe units, one stripe unit from each disk in the array. Thus, "stripe size" is equal to the size of a stripe unit times the number of data disks in the array.
In an example, RAID level 5 utilizes data interleaving by striping data across all disks and provides for error correction by distributing parity data across all disks. For each stripe, all stripe units are logically combined with each of the other stripe units to calculate parity for the stripe. Logical combination is typically accomplished by an exclusive or (XOR) of the stripe units. For N physical drives, N-1 of the physical drives will receive a stripe unit for the stripe and the Nth physical drive will receive the parity for the stripe. For each stripe, the physical drive receiving the parity data rotates such that all parity data is not contained on a single disk. I/O request rates for RAID level 5 are high because the distribution of parity data allows the system to perform multiple read and write functions at the same time. RAID level 5 offers high performance, data availability and fault tolerance for the data disks.
Disk arrays are preferably configured to include logical drives which divide the physical drives in the disk array into logical components which may be viewed by the host as separate drives. Each logical drive includes a cross section of each of the physical drives and is assigned a RAID level. For example, a RAID system may include 10 physical drives in the array. The RAID system is accessible by a network of 4 users and it is desirable that each of the users have separate storage on the disk array. Therefore the physical drives will be divided into at least four logical drives where each user has access to one of the logical drives. Logical drive 1 needs to be configured to RAID level 5. Therefore, data will be interleaved across the cross sections of nine of the physical drives utilized by logical drive 1 and parity data will be stored in the cross section of the remaining physical drive.
A host computer may provide data to the data storage system. The data is preferably received into a cache associated with the RAID controller. When data is received into the cache, the RAID controller can return a signal to the host computer that the data has been received even though the data has not been stored in the data storage drives. By receiving data into the cache before storage as stripes in the data storage drives, the performance of the data storage system may be enhanced.
Data previously striped across the data storage drives may be updated by new data received into pages of a cache associated with the data storage system. Data received for updating previously stored data is considered dirty data until written to the data disks and the dirty data indicator turned off. The dirty data in the cache may include sufficient pages of data to completely update at least one stripe or may include pages of data to update stripe units of multiple stripes. Pages of data may include all sectors for a stripe unit or an assortment of sectors for a stripe unit.
Before dirty data may be flushed to the data storage drives, updated parity must be calculated for the stripe which will be updated with dirty data. If all the sectors for a stripe unit are included in a dirty data page and all the stripe units for the stripe are also included in the pages of dirty data, then the updated parity for the stripe may be calculated and the dirty data sectors flushed together. However, if an assortment of sectors for a stripe unit are included in a page of dirty data, the updated parity may not be calculated for the entire stripe without further fetching of stripe units from the data storage drives.
Typically, when an assortment of sectors are to be updated, the parity for each sector is calculated and the sector and parity are written sector by sector. For example, if sector 7 of a stripe unit D4 of stripe 2 is to be updated, then using a method termed the RMW method, the parity would be calculated by fetching the old sector 7 of stripe unit D4 of stripe 2 and the old parity sector 7 of stripe 2 into additional pages in the cache if each of the data is not already in the cache. The received sector 7 would be XORed with the old sector 7 and the result XORed with the old parity sector 7 to calculate the new parity sector 7 for updating the old parity sector 7 in the cache. The received sector 7 and the new parity 7 would be written to stripe 2. Therefore, assuming that the old data and/or old parity for sector 7 are not already in the cache, the updating of sector 7 of stripe unit D4, would require two reads and two writes. By updating data sector by sector, for multiple sectors in a stripe unit, the parity would need to be recalculated for each sector, which is detrimental to the performance of the RAID level 5 data storage system.
Therefore, it should be apparent to one skilled in the art that an improved method and system that permits updating of non-contiguous sectors of data in a data storage system is needed where input/output operations may be minimized.